import {request} from "@/http";
import type {article, Category, health, jj, search, swiper, teacher} from "@/http/home/module";
import type {LocationQueryValue} from "vue-router";

//尝试
const tryTest = function (data: jj) {
    return request({method: 'get', url: '/system/article/list', data: data})
}

// 轮播图
const indexSwiper = function (data: swiper) {
    return request({method: 'get', url: '/slideshow/list', data: data})
}

// 健康中心介绍
const healthRecommend = function (data: health) {
    return request({method: 'get', url: '/platform/text/list', data: data})

}

//咨询师内容
const teacherContent = function (data: teacher) {
    return request({method: 'get', url: '/system/teacher/list', data: data})
}

// 咨询师详情
const teacherDetail = function (id: string | null | LocationQueryValue[]) {
    return request({method: 'get', url: `/system/teacher/${id}`})
}

// 文章列表请求
const articleContent = function (data: article) {
    return request({method: 'get', url: '/system/article/list', data: data})
}

// 文章详情请求
const articleDetail = function (id: string | null | LocationQueryValue[] | number) {
    return request({method: 'get', url: `/system/article/${id}`})
}
// 搜索
const searchContent=function (data:search) {
    return request({method:'get',url:'/system/article/research',data:data})
}

// 文章分类
const articleCategory=function (data:Category){
    return request({method:'get',url:'/system/category/list',data})
}


export {tryTest, indexSwiper, healthRecommend, teacherContent, teacherDetail, articleContent, articleDetail,searchContent,articleCategory}